package com.member.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.servlet.ModelAndView;

import com.member.dao.MemberDao;
import com.member.domain.MemberCommand;

@Controller
public class MyPageController {
	
	@Autowired
	private MemberDao memberDao;
	
	/*public void setMemberDao(MemberDao memberDao) {
		this.memberDao = memberDao;
	}*/
	
	@RequestMapping(value="/member/myPage.do",method=RequestMethod.GET)
	public ModelAndView process(HttpSession session){
		String id = (String)session.getAttribute("id");
		MemberCommand memberCommand = memberDao.getMember(id);
		return new ModelAndView("myPage","memberCommand",memberCommand);
	}
}
